﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;

public partial class top_ad : System.Web.UI.Page
{
    protected string pic = "";
    protected void Page_Load(object sender, EventArgs e)
    {
       // ad/1.jpg|ad/2.jpg|ad/3.jpg|ad/4.jpg

        string sql = "select top 5 * from Whir_U_News where TypeID=4 or TypeID in (select ColumnID from Whir_Column where ParentId=4) and UploadImg<>'' and  IsTop='是' order by CreateDate desc";
        DataTable dt = Whir.SQLServerDAL.DbHelperSQL.Query(sql).Tables[0];
        StringBuilder sb = new StringBuilder();
        if (dt != null && dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                sb.Append(Whir.Common.Settings.GetPicServer() + dr["UploadImg"].ToString() + "|");

            }
        }
        pic = sb.ToString().TrimEnd('|');
    }
}
